home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC]
/
NeXTSTEP 3.3 Dev Intel.iso
/
NextDeveloper
/
Source
/
GNU
/
debug
/
Common
/
RelocManager.h
< prev
next >
Wrap
Text File
|
1994-11-29
|
2KB
|
73 lines
#import <objc/Object.h>
#import <mach/mach.h>
#import <mach-o/loader.h>
typedef struct _Reloc {
pointer_t address;
vm_size_t size;
pointer_t data;
vm_address_t maxAddress;
long displacement;
pointer_t maxData;
struct {
unsigned short readIn : 1;
} rFlags;
} Reloc;
#define WARPM(m, p) \
((typeof(p))[(m) pointerFor: (p) withSize: sizeof(*(p))])
#define WARP(p) WARPM(regionManager, p)
#define WARPIDM(m, theID) \
([(m) pointerForID: (id)(theID)])
#define WARPID(theID) WARPIDM(regionManager, theID)
#define UNWARPM(m, p) \
((typeof(p))[(m) originalPointerFor: (p)])
#define UNWARP(p) UNWARPM(regionManager, (p))
#define WARPSTRINGM(m, s) ((char *)[(m) pointerForString: (s)])
#define WARPSTRING(s) WARPSTRINGM(regionManager, s)
@interface RelocManager : Object
{
void *relocs;
int numRelocs;
int relocSize;
struct _rmFlags {
unsigned short invalid : 1;
unsigned short shouldSortRelocs : 1;
} rmFlags;
Reloc *lastReloc;
}
-(void *)pointerFor: (const void *)pointer;
-(void *)pointerFor: (const void *)pointer withSize: (int)size;
-(char *)pointerForString: (const char *)pointer isNullTerminated: (BOOL *)isNT;
-(char *)pointerForString: (const char *)string;
-(id)pointerForID: (const id)pointer;
-(void *)originalPointerFor: (const void *)pointer;
-(int)getDataAt: (const void *)start for: (int)numBytes into: (void *)data;
-(struct mach_header **)getMachHeaders;
-(struct mach_header **)getMachHeadersWithNames: (char ***)names;
-(struct mach_header *)getMachHeader;
-(void *)getSectData: (STR)segName section: (STR)sectName size: (int *)pSize forHeader: (struct mach_header *)header;
-(void *)getSectData: (STR)segName section: (STR)sectName size: (int *)pSize;
-(const struct section *)getSeg: (STR)segName sect: (STR)sectName;
-invalidate;
-(void)readInAllRelocs;
-(Reloc *)relocFor: (const void *)pointer;
-(Reloc *)oldRelocFor: (const void *)pointer;
-(BOOL)readInReloc: (Reloc *)reloc;
-(const struct section *)firstSection;
-(unsigned)getMaximumAddress;
-(unsigned)getMaximumAddressForHeader: (struct mach_header *)header;
-(unsigned)getMaximumTextAddress;
-(unsigned)getMaximumDataAddress;
@end